package com.feng.controller;


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.feng.entity.Sentence;
import com.feng.service.ISentenceService;
import com.feng.util.CommonUtils;
import com.feng.util.PageUtil;

/**
 * 语句相关
 * @author qf
 *
 */
@Controller
public class SentenceController {

	
	private final Log log=LogFactory.getLog(SentenceController.class);
	@Autowired
	private ISentenceService sentenceService;
	
	
	@ResponseBody
	@RequestMapping("qrySentenceData")
	public PageUtil<Sentence> qrySentenceData(String pageNum){
		PageUtil<Sentence> vo = new PageUtil<Sentence>();
		try {
			if(CommonUtils.isNotEmpty(pageNum)){
				vo.setPageNum(Integer.parseInt(pageNum));
			}
			vo = sentenceService.findSentencesByPage(vo);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		return vo;
	}
}
